package frontend.lexer.token;

public class Token {
    private final TokenType tokenType;
    private final String tokenString;
    private final int lineNum;
    private final int linePosStart;
    private final int linePosEnd;
    private final String line;

    public Token(TokenType tokenType, String tokenString, int lineNum, String line, int linePosStart, int linePosEnd) {
        this.tokenType = tokenType;
        this.tokenString = tokenString;
        this.lineNum = lineNum;
        this.line = line;
        this.linePosStart = linePosStart;
        this.linePosEnd = linePosEnd;
    }

    public TokenType getTokenType() {
        return tokenType;
    }
    public String getTokenString() {
        return tokenString;
    }
    public int getLineNum() {
        return lineNum;
    }
    public String getLine() {
        return line;
    }
    public int getLinePosStart() {
        return linePosStart;
    }
    public int getLinePosEnd() {
        return linePosEnd;
    }

    @Override
    public String toString() {
        return tokenType.toString() + ' ' + tokenString;
    }
//    @Override
//    public String toString() {
//        return tokenType.toString() + ' ' + tokenString + String.format("[%d:%d-%d s:%s i:%d l:%s]", lineNum, linePosStart, linePosEnd, stringVal, intVal, line);
//    }
}
